package service

import (
	"context"
	"micro.user.action.server/ao"
	"micro.user.action.server/utils"

	pb "gitee.com/micro-services/protocol/user/server"
)

type UserActionControl struct{}

func (uc *UserActionControl) UserRegistry(ctx context.Context, r *pb.UserRegistryReq, w *pb.UserRegistryRsp) error {
	defer utils.Logf(ctx, "UserRegistry", r)(w)
	return ao.UserRegistry(ctx, r, w)
}

func (uc *UserActionControl) UserLogin(ctx context.Context, r *pb.UserLoginReq, w *pb.UserLoginRsp) error {
	defer utils.Logf(ctx, "UserLogin", r)(w)
	return ao.UserLogin(ctx, r, w)
}

func (uc *UserActionControl) UserInfo(ctx context.Context, r *pb.UserInfoReq, w *pb.UserInfoRsp) error {
	defer utils.Logf(ctx, "UserInfo", r)(w)
	return ao.UserInfo(ctx, r, w)
}

func (uc *UserActionControl) WxUserLogin(ctx context.Context, r *pb.WxUserLoginReq, w *pb.WxUserLoginRsp) error {
	defer utils.Logf(ctx, "WxUserLogin", r)(w)
	return ao.WxUserLogin(ctx, r, w)
}

func (uc *UserActionControl) WxUserInfo(ctx context.Context, r *pb.WxUserInfoReq, w *pb.WxUserInfoRsp) error {
	defer utils.Logf(ctx, "WxUserInfo", r)(w)
	return ao.WxUserInfo(ctx, r, w)
}

func (uc *UserActionControl) UpdateWxUserInfo(ctx context.Context, r *pb.UpdateWxUserInfoReq, w *pb.UpdateWxUserInfoRsp) error {
	defer utils.Logf(ctx, "UpdateWxUserInfo", r)(w)
	return ao.UpdateWxUserInfo(ctx, r, w)
}

func (uc *UserActionControl) AdminUserRegistry(ctx context.Context, r *pb.AdminUserRegistryReq, w *pb.AdminUserRegistryRsp) error {
	defer utils.Logf(ctx, "AdminUserRegistry", r)(w)
	return ao.AdminUserRegistry(ctx, r, w)
}

func (uc *UserActionControl) AdminUserLogin(ctx context.Context, r *pb.AdminUserLoginReq, w *pb.AdminUserLoginRsp) error {
	defer utils.Logf(ctx, "AdminUserLogin", r)(w)
	return ao.AdminUserLogin(ctx, r, w)
}

func (uc *UserActionControl) AdminUserInfo(ctx context.Context, r *pb.AdminUserInfoReq, w *pb.AdminUserInfoRsp) error {
	defer utils.Logf(ctx, "AdminUserInfo", r)(w)
	return ao.AdminUserInfo(ctx, r, w)
}
